package com.yotoodesign.dianba.custom;

import com.yotoodesign.dianba.R;

import android.content.Context;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

public class PinYinSearch extends LinearLayout {
	private Context mContext;

	/*
	 * 显示当前输入的拼音
	 */
	private TextView txtInputed;
	/*
	 * 删除按钮
	 */
	private ImageButton btnBack;
	
	/*
	 * 当前输入的文本
	 */
	private String text = "";
	
	
	public Context getmContext() {
		return mContext;
	}

	public void setmContext(Context mContext) {
		this.mContext = mContext;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public PinYinSearch(Context context) {
		super(context);
		
		RelativeLayout textLayout = new RelativeLayout(context);
		
		txtInputed = new TextView(context);
		btnBack = new ImageButton(context);
		btnBack.setBackgroundResource(R.drawable.remove_button);
		
		RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
				RelativeLayout.LayoutParams.WRAP_CONTENT,
				RelativeLayout.LayoutParams.WRAP_CONTENT);
		btnBack.setLayoutParams(params);

		textLayout.addView(txtInputed, new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT,
                LayoutParams.WRAP_CONTENT));
		textLayout.addView(btnBack, new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
                LayoutParams.WRAP_CONTENT));
		
		
	}

}
